package run;

import com.SpringBootApps;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.web.client.RestTemplate;
import utils.Utils;

import java.lang.ref.WeakReference;

@SpringBootTest(classes = {StartUp.Dummy.class},
        webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class StartUp {
    Object lock = new Object();
    @Autowired
    GenericApplicationContext applicationContext;


    @Test
    public void mdcTest(){

    }

    @Test
    public void verify() throws InterruptedException {

        Utils.print(applicationContext);
        synchronized (lock) {
            lock.wait();
        }
    }

    @Import(value = SpringBootApps.class)
    @Configuration
    public static class Dummy {
        public static String name;

    }

}
